﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GSLMS.Entity;
using GSLMS.Entity.Enum;
using GSLMS.Core;

namespace GSLMS.WebAPP.Areas.CustManage.Controllers.CustBad
{
    public class CustBadController : AdminBaseController
    {
        //
        // GET: /CustManage/CustBad/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public string Create(FormCollection collection)
        {
            string result = string.Empty;
            string tips = "";
            

            if (tips.Trim() == "")
            {
                try
                {


                    int num = 0;
                    if (num == 1)
                    {

                        //string str = "\"statusCode\":\"{0}\", \"message\":\"{1}\", \"navTabId\":\"{2}\", \"forwardUrl\":\"{3}\", \"callbackType\":\"{4}\"";

                        // System/Employee/index
                        //string.Format(str, 200, "保存成功", "Employee", "System/Employee/index", "closeCurrent");

                        result = AjaxResultSucess;
                    }
                    else if (num == -1)
                    {
                        result = string.Format(HelperCommon.AJAXFORMAT, 300, "用户名已经存在。", navTabId, "", "");
                    }
                    else if (num == -2)
                    {
                        result = string.Format(HelperCommon.AJAXFORMAT, 300, "登录密码不能为空。", navTabId, "", "");
                    }
                    else
                    { result = AjaxResultFail; }
                }
                catch (Exception ex)
                {
                    base.ExceptionHand(ex);
                    result = AjaxResultFail;
                }
            }
            else
            {
                result = string.Format(HelperCommon.AJAXFORMAT, 300, tips, navTabId, "", "");
            }

            return "{" + result + "}";
        }

    }
}
